﻿//------------------------------------------------------------------------------
// System Name:    Customer Service Platform
// Component:      LogInfo Control
// Created By:     Samara Jiang (samaraj@wicresoft.com)
// Created Date:   2011-2-15
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ASBCC.Business;
using ASBCC.Business.CIS;
using ASBCC.Database.EntityFramework;

namespace BEGDC.CC.Web.Admin
{
    /// <summary>
    ///  LogInfo Control
    /// </summary>
    public partial class LogInfoCommon : EntityUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected override EntityDataSource EntitySource
        {
            get { return this.edsLog; }
        }

        protected override TextBox EntitySearchTxt
        {
            get { return this.SearchText; }
        }

        protected override Button EntityAddBtn
        {
            get { return this.BtnAdd; }
        }

        protected override Button EntitySearchBtn
        {
            get { return this.Searchbtn; }
        }

        protected override Button EntityClearBtn
        {
            get { return this.Cleanbtn; }
        }

        protected override GridView EntityGrid
        {
            get { return this.gvLog; }
        }

        protected override DetailsView EntityDetails
        {
            get { return this.dvLog; }
        }



        protected override void OnEntityDisabling(int entityKey)
        {

        }

        protected override string GetEntityWhereExpression(string keyword)
        {
            return "(it.Description like N'%" + keyword + "%')";

        }

        protected override void OnEntityInserting(EntityDataSourceChangingEventArgs e)
        {

        }

        protected override void OnEntityUpdating(EntityDataSourceChangingEventArgs e)
        {

        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            this.EntityAddBtn.Visible = false;
            this.EntityDetails.ChangeMode(DetailsViewMode.ReadOnly);
        }


        ///// <summary>
        ///// 通过employeeNo取Departments
        ///// </summary>
        //protected string GetDepartments(string employeeNo)
        //{
        //    using (var dc = new CCEntities())
        //    {

        //        var employee = dc.Employees.First(p => p.EmployeeNo == employeeNo).Department.DepartmentCode;
        //        //var d = employee.Department.DepartmentCode;

        //        return employee;
        //    }
        //}


    }
}